<%@page import="java.net.URLEncoder"%>
<%@page import="ContentManagers.Security.Hasher"%>
<%@page import="ContentManagers.Security.Validator"%>
<%@page import="ContentManagers.RoleManagers.AdminSessionManager"%>
<%@page import="ContentManagers.Servlets.ServletAddPM"%>
<%@page import="java.sql.SQLException"%>
<%@page import="java.sql.ResultSet"%>
<%@page import="java.sql.PreparedStatement"%>
<%@page import="java.sql.Connection"%>
<%@page import="DBConnection.ConnectionFactory"%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@page import="ContentManagers.RoleManagers.PMManager"%>


<div id="left_sidebar" class ="content_box" >
    
    Browse Items <smallerfont style="font-size: 10pt;">
    <%
    try{   ResultSet rs = new PMManager().getProductTypes();
           if(rs == null){
              %> 
                Database connection error.
              <% }
              else
                 {
                     while(rs.next())
                     {
                         %><a href="searchpage.jsp?byCategory=<% out.println(rs.getString("product_type_id"));%> ">
                         <% out.println("<br>&nbsp;-&nbsp;" + rs.getString("product_type_name")); %> </a> <%
                     }
                     
                 }
        }catch(Exception e){ } %>
        </smallerfont>       
            <form name ="item_search" method="post" onsubmit="" action="searchpage.jsp">
                <br><br><input class="searchbox" type="text" value="Search Foobar" name="searchItems" autocomplete ="off" onfocus="clearInitial(this, 'Search Foobar')"/>
                <br><select name="searchType">
                    <option value='0'>All Items</option>
                    <%
                    try{   ResultSet rs = new PMManager().getProductTypes();
                    
                        if(rs == null){
                            %> 
                                Database connection error.
                            <% }
                        else
                        {
                             while(rs.next())
                                {
                                out.println("<option value='"+rs.getInt("product_type_id")+"'>" + rs.getString("product_type_name") + "</option>");
                                }
                        }
                       }catch(Exception e){ }
                    %>
                    </select>
                <input type="submit" name="submitSearch" value="Go!"/>
            </form></div>

